package com.ffyc.resale.util;

import com.ffyc.resale.model.Result;
import org.mybatis.logging.Logger;
import org.mybatis.logging.LoggerFactory;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

/**
 * 统一异常处理
 */
@RestControllerAdvice
public class GlobalExceptionHandler {
    private static Logger logger = LoggerFactory.getLogger(GlobalExceptionHandler.class);
    @ExceptionHandler(Exception.class)
    public Result globalExceptionHandler(Exception e){
        Result res= new Result(500,"系统忙"+e.getMessage(),null);
        e.printStackTrace();
        return res;
    }
}
